<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>普通标签</title>
    <style>
        .active{
            color: red;
        }

    </style>
</head>
<body>
    <div class="one" style="width: 100px; height: 100px;">
        <b>hello world</b>
        <!-- 注释 -->
    </div>
    <script>
         console.dir(document.querySelector(".one").innerHTML);
         console.dir(document.querySelector(".one").textContent);
         let one =document.querySelector(".one");
         // one.innerHTML="<a href=''>链接</a>";
         one.textContent="<a href=''>链接</a>";
         // one.className="active";
         one.classList.add("active");
         one.classList.remove("active");
         one.classList.toggle("active");
         one.classList.toggle("active");
         console.log(one.classList.contains("active"));  
         console.log(one.style)
        //  one.style.color="red";
        //  one.style.border="1px solid red";
        //  one.style.backgroundColor="antiquewhite";
        one.style.cssText="color:red;border:1px solid red;background-color:yellow;width:200px";
        console.log(getComputedStyle(one).width);
    </script>
</body>
</html>